package com.ddyx.service.user.api.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *     用户VO对象
 * </p>
 * class: UserVo.java
 * author: agula
 * since: 2019-07-12  11:59
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "user", description = "用户对象")
public class UserVo implements Serializable {

    @NotBlank(message = "用户名不能为空")
    @Length(min = 2, max = 10, message = "name 长度必须在 {min} - {max} 之间")
    @ApiModelProperty(value = "用户名", required = true, example = "18515990924")
    private String name;

    @NotBlank(message = "手机号不能为空")
    @ApiModelProperty(value = "手机号", required = true, example = "18515990924")
    private String phone;

    @NotBlank(message = "验证码不能为空")
    @ApiModelProperty(value = "验证码", required = true)
    private String verifyCode;

    @ApiModelProperty(value = "密码", required = true)
    private String password;

    @NotNull(message = "price不允许为空")
    @DecimalMin(value = "0.1", message = "价格不能低于 {value}")
    private BigDecimal price;

    @ApiModelProperty(value = "昵称")
    private String nickName;
    /**
     * 性别 1男性 2女性
     */
    @Max(value = 3, message = "参数错误, gender必须小于3")
    @Min(value = 0, message = "参数错误, gender必须大于0")
    @ApiModelProperty(value = "性别", allowableValues="1,2")
    private Integer gender;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;

    @ApiModelProperty(value = "头像")
    private String headImage;

}
